Computer tracing (or tracing) relates to recording information about a computer program's execution, such as recording the value or state of particular variables or functions at particular times during execution. Tracing may be a specialized form of logging, and may be useful in debugging, code security, performance analysis and other applications.
Typically, a computer programmer or user is responsible for writing the trace code. The process is typically done manually or automated by programming a software or hardware tool to observe execution. For example, users may manually insert code to record the information helpful to them in the source code. This auxiliary code is put under a DEBUG flag and is eliminated in the released version of the computer program. In another example, a compiler may automatically generate code to record needed information. In both examples, large amounts of trace information may be created that may be very difficult to analyze without tools.
Dynamic binary instrumentation tools may also be used. Instrumentation is performed at run time on the compiled binary files. Binary modification of the code is tricky, very intrusive and may alter the behavior or performance of the computer program, such as adding to execution time. Further, the computer program may need to be recompiled and rebuilt.
Tracing may effect the behavior of the computer program in DEBUG mode and RELEASE mode, and as a consequence may mask a bug. Tracing may also add to the execution time of the computer program because of the overhead of executing extra code. It is desirable to have tools to help in testing and analyzing a computer program at run time, without side effects on the computer program behavior.